<%
'广播电台播放器
Function RadioPlayer(fileurl)
	Dim str
	str = MediaPlayer(fileurl)
	'str = CMP4Player(fileurl)
	RadioPlayer = str
End Function

Function MediaPlayer(fileurl)
	Dim str : str = ""
	str = str& "<object id=""MediaPlayerObj"" type=""application/x-oleobject"" " & vbCrLf
	str = str& "width=""100%"" height=""64"" " & vbCrLf
	str = str& "onError=""if(window.confirm('您尚未安装Windows Media Player,请先安装后重新点击刷新.')){window.open('http://www.microsoft.com/windows/windowsmedia/download/')}else{self.location.href='#'}"" " &vbCrLf
	str = str& "classid=""CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"">" & vbCrLf
	str = str& "<param name=""url"" value="""+fileurl+""">" & vbCrLf
	str = str& "<param name=""autoStart"" value=""true"">" & vbCrLf
	str = str& "<param name=""playCount"" value=""1000"">" & vbCrLf
	str = str& "<param name=""defaultFrame"" value=""datawindow"">" & vbCrLf
	str = str& "<embed name=""player"" type=""application/x-mplayer2"" " & vbCrLf
	str = str& " pluginspage=""http://www.microsoft.com/windows/windowsmedia/download/"" " & vbCrLf 
	str = str& " style=""left: 0px; top: 0px; width: 100%; height: 64px;"" " & vbCrLf
	str = str& " src="""&fileurl&""" " & vbCrLf
	str = str& " url="""&fileurl&""" " & vbCrLf  
	str = str& " showcontrols=""1"" showdisplay=""0"" showstatusbar=""1"" " & vbCrLf
	str = str& " showpositioncontrols=""1"" showtracker=""1"" " & vbCrLf
	str = str& " showaudiocontrols=""1"" showgotobar=""0"" showcaptioning=""0"" " & vbCrLf
	str = str& " autostart=""1"" autosize=""0"" animationatstart=""0"" autorewind=""0"" " & vbCrLf
	str = str& " transparentatstart=""0"" allowscan=""0"" enablecontextmenu=""0"" " & vbCrLf
	str = str& " clicktoplay=""0"" invokeurls=""1"" defaultframe=""datawindow"" " & vbCrLf
	str = str& " playcount=""1000"" volume=""100"" " & vbCrLf
	str = str& " width=""100%"" height=""64"">" & vbCrLf
	str = str& "</embed>" & vbCrLf
	str = str& "</object>" & vbCrLf
	MediaPlayer = str
End Function

Function RealPlayer(fileurl)
	Dim str : str = ""
	str = str& "<OBJECT id=""RealPlayerObj"" mediatype=""1"" " & vbCrLf
	str = str& "width=100% height=50 align=""middle"" " & vbCrLf
	str = str& "onError=""if(window.confirm('您尚未安装Real Player,请先安装后重新点击刷新.')){window.open('http://realplayer.cn.real.com/')}else{self.location.href='#'}"" " &vbCrLf
	str = str& "classid=""clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"" " &vbCrLf 
	str = str& "codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"">" &vbCrLf
	str = str& "<param name=""_ExtentX"" value=""16140"" />" & vbCrLf
	str = str& "<param name=""_ExtentY"" value=""1588"" />" & vbCrLf
	str = str& "<param name=""CONTROLS"" value=""StatusBar,ControlPanel"" />" & vbCrLf
	str = str& "<param name=""CONSOLE"" value=""Clip1"" />" & vbCrLf
	str = str& "<param name=""MENU"" value=""true""/>" &vbCrLf
	str = str& "<param name=""SRC"" value="""&fileurl&""" />" & vbCrLf
	str = str& "<param name=""AUTOSTART"" value=""true"" />" & vbCrLf
	str = str& "<param name=""LOOP"" value=""true"" />" & vbCrLf
	str = str& "<param name=""NUMLOOP"" value=""0"" />" & vbCrLf
	str = str& "<param name=""SHUFFLE"" value=""0"" />" & vbCrLf
	str = str& "<param name=""PREFETCH"" value=""0"" />" & vbCrLf
	str = str& "<param name=""NOLABELS"" value=""0"" />" & vbCrLf
	str = str& "<param name=""CENTER"" value=""0"" />" & vbCrLf
	str = str& "<param name=""MAINTAINASPECT"" value=""0"" />" & vbCrLf
	str = str& "<param name=""BACKGROUNDCOLOR"" value=""#000000"" />" & vbCrLf
	str = str& "<embed mediatype=""1"" type=""audio/x-pn-realaudio-plugin"" " &vbCrLf
	str = str& "console=""Clip1"" controls=""ControlPanel,StatusBar"" " & vbCrLf
	str = str& "pluginspage=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"" " &vbCrLf
	str = str& "src='"&fileurl&"' "&vbCrLf 
	str = str& "width=""100%"" height=""50"" autostart=""true"" loop=""true""  menu=""true"">" &vbCrLf
	str = str& "</embed>" &vbCrLf
	str = str& "</object>" &vbCrLf
	RealPlayer = str
End Function

Function CMP4Player1(fileurl)
	Dim str : str = ""
	str = str& "<script type='text/javascript' src='"& App.StaticPath &"/player/cmp/cmp.js'></script>" & vbCrLf
	str = str& "<script type='text/javascript'>" & vbCrLf
	str = str& "CMP.write('cmp4player', '100%', '20', '"& App.StaticPath &"/player/cmp/cmp.swf', 'url=&lists=&context_menu=2&auto_play=1&src="+fileurl+"&skin=skins%2Fmini%2Fjwplayer.zip', {});" & vbCrLf
	str = str& "</script>" & vbCrLf
	str = str& "<style>#player_td{height:22px}</style>" & vbCrLf
	CMP4Player1 = str
End Function

Function CMP4Player2(fileurl)
	Dim str : str = ""
	str = str& "<script type='text/javascript' src='"& App.StaticPath &"/player/cmp/cmp.js'></script>" & vbCrLf
	str = str& "<object type='application/x-shockwave-flash' data='http://cmp.cenfun.com/cmp4/cmp.swf' width='100%' height='20' id='cmp4player'>" & vbCrLf
	str = str& "<param name='movie' value='"& App.StaticPath &"/player/cmp/cmp.swf' />" & vbCrLf
	str = str& "<param name='allowfullscreen' value='true' />" & vbCrLf
	str = str& "<param name='allowscriptaccess' value='always' />" & vbCrLf
	str = str& "<param name='flashvars' value='url=&lists=&context_menu=2&auto_play=1&src="+fileurl+"&skin=skins%2Fmini%2Fjwplayer.zip' />" & vbCrLf
	str = str& "<embed name='cmp4player' type='application/x-shockwave-flash' width='100%' height='20' src='"& App.StaticPath &"/player/cmp/cmp.swf?src="+fileurl+"&amp;skins=skins/mini/jwplayer.zip&amp;bgcolor=ffffff&amp;config=0' allowscriptaccess='always' allowfullscreen='true'>" & vbCrLf
	str = str& "</embed>" & vbCrLf
	str = str& "</object>" & vbCrLf
	str = str& "<style>#player_td{height:22px}</style>" & vbCrLf
	CMP4Player2 = str
End Function

Function CMP4Player(fileurl)
	'fileurl = "mms://au.hebradio.com/live6"
	Dim str : str = ""
	str = str& "<script type='text/javascript' src='"& App.StaticPath &"/player/cmp/cmp.js'></script>" & vbCrLf
	str = str& "<script type='text/javascript' src='"& App.StaticPath &"/player/cmp/wmp.js'></script>" & vbCrLf
	str = str& "<div id='cmp_area' style='position:relative;width:100%;height:20px;margin:0px auto;'></div>" & vbCrLf
	str = str& "<script type='text/javascript'>" & vbCrLf
	str = str& "//cmp回调函数，即cmp第一次加载完成时调用，将对wmp进行初始化操作" & vbCrLf
	str = str& "function cmp_loaded(key) {" & vbCrLf
	str = str& "	var cmpo = CMP.get('cmp');" & vbCrLf
	str = str& "	if (!cmpo) {" & vbCrLf
	str = str& "		alert('CMP初始化错误');" & vbCrLf
	str = str& "		return;" & vbCrLf
	str = str& "	}" & vbCrLf
	str = str& "	var list = '<list>';" & vbCrLf
	str = str& "	list += ""<m type='wmp' label='wmp - 青檬电台' src='"+fileurl+"' />"";" & vbCrLf
	str = str& "	list += '</list>';" & vbCrLf
	str = str& "	cmpo.list_xml(list);" & vbCrLf
	str = str& "	//初始化扩展接口" & vbCrLf
	str = str& "	if (CMPEI) {" & vbCrLf
	str = str& "		CMPEI.init(key, cmpo);" & vbCrLf
	str = str& "	} else {" & vbCrLf
	str = str& "		alert('CMP扩展接口初始化错误');" & vbCrLf
	str = str& "	}" & vbCrLf
	str = str& "}" & vbCrLf
	str = str& "//cmp的参数，必须设置api=cmp_loaded回调函数" & vbCrLf
	str = str& "var flashvars = {" & vbCrLf
	str = str& "	url : ''," & vbCrLf
	str = str& "	lists : ''," & vbCrLf
	str = str& "	//auto_play : 1," & vbCrLf
	str = str& "	skin : 'skins/mini/jwplayer.zip', //皮肤" & vbCrLf
	str = str& "	api : 'cmp_loaded' //脚本api回调函数" & vbCrLf
	str = str& "};" & vbCrLf
	str = str& "//将cmp放在一个固定容器cmp_area里，便于后面设置位置，宽高都设置成100%，也就是随容器宽高进行改变" & vbCrLf
	str = str& "//必须把cmp垫底，即设置wmode='opaque'，这样wmp窗口才能覆盖显示在cmp上面" & vbCrLf
	str = str& "var htm = CMP.create('cmp', '100%', '100%', '"& App.StaticPath &"/player/cmp/cmp.swf', flashvars, {wmode:'opaque'});" & vbCrLf
	str = str& "document.getElementById('cmp_area').innerHTML = htm;" & vbCrLf
	str = str& "</script>" & vbCrLf
	str = str& "<style>#player_td{height:22px}</style>" & vbCrLf
	CMP4Player = str
End Function
%>